import { ccs } from "../util/services";
import { workType } from "./gameType";


export class WorkerClass {

    public earnDay: number = 10;
    public wealth: number = 10;
    public work: workType = null;
    public workIndex: number = 0;

    // constructor() {
    //     this.init();
    // }
    initWorker() {
       let workList = ccs.dataMgr.getJsonData('workType');
       this.workIndex = parseInt(Math.random()*5 + '');
       this.setWork(workList[this.workIndex]);
    }
    setWork(work: workType) {
        this.work = work;
    }
    
}